package com.auctionhaus

class Customer {
	//C1
	String emailAddress
	String password
	Date date

	static hasMany = [bid:Bid, listings:Listing]
    static fetchMode = [listings:'eager']



    static mappedBy = [listings:'seller', listings:'winner', bid: 'buyer']
	static constraints = {     

	    // C-3
	    emailAddress(email:true, unique:true, blank:false)
	
	    // C-4
	    password(blank: false, nullable: false, size:6..8)
    }

    static mapping = {
        listings cascade:'none'
        //listings lazy:false
  }


}
